import { Navigate } from "react-router-dom"
import About from "../pages/About";
import Home from "../pages/Home";
import News from "../pages/News";
import Message from "../pages/Message";

const routes = [
    {
        path: '/home',
        element: <Home />,
        children: [
            {
                path: '/home/news',
                element: <News />
            },
            {
                path: '/home/message',
                element: <Message />
            },
            {
                path: '/home',
                element: <Navigate to='/home/news' />
            }
        ]
    },
    {
        path: '/about',
        element: <About />
    },
    {
        path: '*',
        element: <Navigate to='/home' />
    },
    {
        path: '*',
        element: <div>404</div>
    }
]

export default routes